/**
 * 
 */
package com.tvt.smsapp_demo.sms;

import android.telephony.SmsManager;

import com.tvt.smsapp_demo.appconfig.xml.XSms;
import com.tvt.smsapp_demo.debug.Debug;

/**
 * @author MR_HIEU
 * 
 */
public class SmsSender {

	private static final String LOG_TAG = "SmsSender";
	private static final SmsManager mSmsManager = SmsManager.getDefault();

	public static void sendTextSMS(String pPhoneNumber, String pMessage) {

		if (pPhoneNumber == null)
			Debug.e(LOG_TAG, "Can't send sms to null phone number!");

		mSmsManager.sendTextMessage(pPhoneNumber, null, pMessage, null, null);
	}

	public static void sendTextSMS(XSms pXSms) {

		if (pXSms != null) {
			sendTextSMS(pXSms.getPhoneNumber(), pXSms.getContent());
		} else
			Debug.e(LOG_TAG, "Can't send text sms for null XSms object!");
	}
}
